package org.logic.fuzzysets.summarizers.workinghours;

import org.dataSource.DataBaseInfo;
import org.logic.fuzzysets.AFuzzySet;
import org.logic.membershipFunctions.TriangularFunction;

public class NormallyWorkingFuzzySet extends AFuzzySet{

	public NormallyWorkingFuzzySet(DataBaseInfo db) {

			double middleFactor = 0.5;
			setMembershipFunction(new TriangularFunction(db.getMinWokingHours(),db.getMaxWorkingHours(),middleFactor));
			setUniverse(db.getAllWorkingHours());
		}
	
	public NormallyWorkingFuzzySet(DataBaseInfo db,String subject) {

		db.setOnlyRecords(subject);
		setSubject(subject);
		double middleFactor = 0.5;
		setMembershipFunction(new TriangularFunction(db.getMinWokingHours(),db.getMaxWorkingHours(),middleFactor));
		setUniverse(db.getAllWorkingHours());
	}

	@Override
	public String getLabel() {
		AFuzzySet qualifier = getQualifier();
		if(qualifier != null && getSubject()==null)
		return " who "+qualifier.getLabel()+" are normally working";
		else
		return "are normally working";
	}

	
}
